Skip to content

fix(repo-universe): validate full_name/html_url/fork fields at the entry gate (#6814) - #6836

Merged
developing-today[bot] merged 1 commit into
mainfrom
queue/6814-universe-field-validation
Nov 7, 2026
Merged

developing-today[bot] merged 1 commit into
mainfrom
queue/6814-universe-field-validation

Conversation

@developing-today

@developing-today developing-today Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Closes #6814 (field-level residual of #6716, generator side; checker side was #6757).

What changed

scripts/fleet/repo-universe/generate.py — validate_entry, the single gate decode_pages, merge_repos, and build all pass through, now validates the fields inside an object entry, in the existing named-error style (source + entry index + offending value):

  • full_name must match the GitHub owner/name shape (FULL_NAME_RE: owner = alphanumerics/hyphens, never leading/trailing; name = [A-Za-z0-9._-]+, not ./..) — rejects empty, slash-less, /leading, and newline-bearing values, so a capture can no longer forge phantom repo entries in doc/fleet/repo-universe.yaml through the verbatim emit in build().
  • html_url, when present and non-null, must be a string with no whitespace/control characters — a non-string no longer renders as Python syntax and a newline can no longer inject an entry. Absent (or null) keeps the current derived-URL fallback.
  • fork, when present and non-null, must be a JSON boolean — a string "false" no longer classifies a real owned repo as a fork and silently drops it from issue watching.

Tests

  • test_generate.py: 17/17 pass (15 pre-existing + 2 new). New: test_field_level_wrong_shapes_fail_named covers all six acceptance cases (empty full_name, slash-less full_name, newline-bearing full_name, non-string html_url, newline-bearing html_url, string "false" fork) plus controls proving well-formed and absent-field entries pass unchanged; test_newline_full_name_capture_fails_named_end_to_end proves the CLI fails named and writes no artifact.
  • Direct probe re-run against build() (the issue's evidence path): all three probe shapes rejected with named errors.
  • test_check_issues.py: 19/19 pass (adjacent suite untouched).
  • Byte-identical regeneration on well-formed inputs is covered by the suite's existing idempotence test, which passes.

Implemented by lane code-b in fallback mode (queue backend down, code#6619), claimed on #6814.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…try gate (#6814)

validate_entry checked only that an entry is an object with a string full_name (#6716); the fields inside went unvalidated, so build() could emit a newline-bearing full_name or html_url verbatim into doc/fleet/repo-universe.yaml (forging phantom repo entries), render a non-string html_url as Python syntax, or classify a repo as fork on a truthy string fork=false and silently un-watch it. The one gate every consumer passes through now also requires: full_name matching the GitHub owner/name shape, html_url (when present and non-null) a string free of whitespace/control characters, and fork (when present and non-null) a JSON boolean - each rejected with the existing named-error style. Regression tests cover the six acceptance cases plus an end-to-end CLI capture; well-formed and absent-field entries are unchanged.
@developing-today
developing-today Bot requested review from a team and dezren39 as code owners November 7, 2026 06:30
@coderabbitai

coderabbitai Bot commented Nov 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d8a2970c-70a5-49c8-8d58-506fbeece928

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

0 participants